// 统一管理用户端的model
var mongoose = require('mongoose')
var {Schema} = mongoose

// 用户表
var userSchema = new Schema({
    username:String,
    password:String,
    avatar:String,
    phone:String,
    email:String
})
var userModel = mongoose.model('userModel',userSchema)

//地址表


//购物车表
let cartSchema = new Schema({
    stock_id: Number,
    title:String,
    sub_title: String,
    image: String,
    imgs: Array,
    price: Number,
    limit_num: Number,
    detail: Object,
    userid: String,
    num:{
        required:true,
        type:Number
    },
    ischeck:{
        required:true,
        type:Boolean
    }
})
let cartModel = mongoose.model('cartModel',cartSchema)



module.exports = {
    userModel,
    cartModel
}
